package com.prs.crm.dao.stock.impl;


import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.stock.SupplierTypeDao;
import com.prs.crm.domain.stock.ProductStore;
import com.prs.crm.domain.stock.SupplierType;

public class SupplierTypeDaoImpl extends BaseDaoImpl<SupplierType> implements SupplierTypeDao{
	

	@SuppressWarnings("unchecked")
	public 	List<SupplierType> getAllTypes()
	{
//		return this.getHibernateTemplate().loadAll(SupplierType.class);
		
		return (List<SupplierType> )getHibernateTemplate().execute(   
			      new HibernateCallback() {   
			        public Object doInHibernate(Session session) throws HibernateException {   
			        	Criteria criteria =  session.createCriteria(SupplierType.class);
			        	
			        	List<SupplierType> result = criteria.list();
			        
			        		return result;
			        }   
			      }   
			    );  
		
		
		
		
		
		
		
		
		
	}
}
